<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="dwr/engine.js"> </script>
<script type='text/javascript' src="dwr/util.js"></script>
<script type="text/javascript" src="dwr/interface/PushDWRManager.js"> </script>
<script type="text/javascript" src="Pub.js"></script>
<title>实例</title>
  <style>
    input.itext { font-size: smaller; background: #E4E4E4; border: 0; }
    input.ibutton { font-size: xx-small; border: 1px outset; margin: 0px; padding: 0px; }
    span.reply { background: #ffffdd; white-space: pre; }
    span.warning { font-size: 10; color: red; }
  </style>

<script type="text/javascript">
function clkTest(){
	alert('开始测试');
	PushDWRManager.getTest(reply);
}

var reply = function(data){
   if (data != null && typeof data == 'object') alert(dwr.util.toDescriptiveString(data, 2));
   else dwr.util.setValue('d0', dwr.util.toDescriptiveString(data, 1));
}
</script>

</head>
<body>
<a href="#" onclick="PushDWRManager.getTest(reply);">DWR测试1</a>
<a href="#" onclick="clkTest()">DWR测试2</a>
<span id='d0' class='reply'></span>
<form method="post" action="myaction">
<label>用户名:</label>
<input type="hidden" name="cls" value="User"  />
<input type="hidden" name="action" value="login" />
<input name="name" type="text"/>
<input type="submit" value="登录"/>
</form>

</body>
</html>